<include file="Base:common_head" />
<div id="bd">
    <div class="left1">
        <include file="User:leftmenu" />
    </div>
    <div class="templist">
        <div class="list J_TWidget" data-widget-type="Tabs" data-widget-config="{
             'triggerType':'click'
             }">
            <ul class="ks-switchable-nav">
               <li class="ks-active">进行中的订单</li>
               <li>已完成的订单</li>
            </ul>
            <div class="contents">
    			<div class="ks-switchable-content">
                	<div><include file="Base:mybill" /></div>
                    <div style="display:none;"><include file="User:myorder" /></div>
                </div>
            </div>   
        </div>
        <script type="text/javascript">
            //购买添加旺旺信息
            function ws(ind){
                $.get('__URL__/allmes/ind/'+ind,function(data){
                    $("#tips").show();
                    $("body").css({"overflow-Y":"hidden"});
                    var h = window.screen.height;
                    var w = window.screen.width;
                    $("#tips").css({"left":(w/2-100)+"px","top":(h/2-100)+"px","display":"block"});
                    $("#tips").html(data);
                });
       
 
            }
            //确认
            function wsy(i,ind){
                var wwname = $("#wwname").val();
                if(i ==1){
                    $.get('__URL__/allmesy/ind/'+ind+'/wwname/'+wwname,function(){
                        $("#qu"+ind).html("等待设计师确认");
                        $("#q"+ind).html("确认");
                        $("#tips").hide();
                        $("body").css({"overflow":"auto"});
                        var h = window.screen.height;
                        var w = window.screen.width;
                        $("#edit").css({"left":(w/2)+"px","top":(h/2-100)+"px","display":"block"});
                        $("#edit").html('修改成功').animate({opacity: 'hide'}, 1000);
                    });
                }else{
                    $("#tips").hide();
                    $("body").css({"overflow":"auto"});
                }
            }
            //设计师确认
            function qu(ind,wwname,id,dom){
                var zgname = $(dom).parent().parent().siblings("#zgname").html(); //掌柜名
                var price = $(dom).parent().parent().siblings(".price").html() * $(dom).parent().parent().siblings(".rate").children("#rate").html() *0.01; //返利费用
                var r=confirm("该用户提交的旺旺名为："+wwname+" ,返现金额为"+price+"请核对无误后确认。现在是否确认完成订单？(订单完成后将返现到该用户)")
                if (r==true){
                    $.get('__URL__/que/ind/'+ind+'/price/'+price+'/zgname/'+zgname+'/id/'+id,function(data){
                        if(data){
                            var h = window.screen.height;
                            var w = window.screen.width;
                            $("#edit").css({"left":(w/2)+"px","top":(h/2-100)+"px","display":"block"});
                            $("#edit").html(data);
                            var t=setTimeout("settime()",1000)
                        }else{
                            $("#query"+ind).html("完成");
                            $("#query1"+ind).html("确认");
                            var h = window.screen.height;
                            var w = window.screen.width;
                            $("#edit").css({"left":(w/2)+"px","top":(h/2-100)+"px","display":"block"});
                            $("#edit").html('确认成功').animate({opacity: 'hide'}, 1000);
							document.location.reload();
                        }
                    });
                }
            }
            function settime(){
                $("#edit").animate({opacity: 'hide'}, 5000);
            }
            function sel(dom){
                var v = $(dom +'option:selected') .val();
                if(v == "qu"){
                    $("#wangwang").show();
                }
            }
            //参数传递
            function pag(i){
                $.get('__URL__/orderlist/i/'+i,function(){
                
                });
            }
            function dell(i,n){
                var r=confirm("确认删除?")
                if (r==true){
                    if(n==1){
                        $("#q"+i).animate({opacity: 'hide'}, 500);
                    }else{
                        $("#w"+i).animate({opacity: 'hide'}, 500);
                    }
                    $.get('__URL__/dellorder/id/'+i,function(data){
                        if(data == 1){
                            var h = window.screen.height;
                            var w = window.screen.width;
                            $("#edit").css({"left":(w/2)+"px","top":(h/2-100)+"px","display":"block"});
                            $("#edit").html('删除成功').animate({opacity: 'hide'}, 1000);
                        }
                    
                    });
                }
            }
        </script>
